package com.hcs.chenyu.moreaboutstudent;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class Mydbstudent extends SQLiteOpenHelper {
    //常量定义
    public static final String name = "student.db";
    public static final int DB_VERSION = 1;

    public static final String CREATE_USERDATA1 = "create table student(mstudentid char(20)primary key," +
            "mstudentname varchar(20),mstudentsex varchar(10),mstudentmajoy varchar(50),mstudentclass varchar(20),mstudenttel char(20)," +
            "mstudentdormNo char(10))";
    //构造函数
    public Mydbstudent(Context context) {
        super(context, name, null, DB_VERSION);
    }
    @Override
    public void onCreate(SQLiteDatabase databasestudent) {
        databasestudent.execSQL(CREATE_USERDATA1);
        databasestudent.execSQL("insert into student(mstudentid,mstudentname,mstudentsex,mstudentmajoy,mstudentclass," +
                "mstudenttel,mstudentdormNo)Values('20192790299','何辰钰','男','软件工程','2班','13145679876','319')");

    }
    @Override
    public void onUpgrade(SQLiteDatabase databasestuduent, int oldVersion, int newVersion) {
    }
}